<%@ page language="java" import="java.util.*" import="com.rw.table.*"
	pageEncoding="UTF-8" contentType="text/html; charset=GBK"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'displayFavorite.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<p>
			<font size="5">我的收藏夹</font>
		</p>
		<%
			int i = 0;
			List<Favoritem> favoriteList = (List<Favoritem>) request
					.getAttribute("favoriteInfoList");
			List<Item> itemList = (List<Item>) request
					.getAttribute("favoriteItemList");
			Iterator<Favoritem> iterator1 = favoriteList.iterator();
			Iterator<Item> iterator2 = itemList.iterator();
			while (iterator1.hasNext()) {
				Favoritem favorite = iterator1.next();
				Item item = iterator2.next();
		%>
		<br>

		<%
			long favoriteId = favorite.getFavoriteId();
			int nowPage = (Integer) request.getAttribute("nowPage");
			int pageSize = (Integer) request.getAttribute("pageSize");
			long userId = favorite.getFavoriteUserId();
			long itemId = favorite.getFavoriteItemId();
			String formId = "form" + i;
		%>
		<a
			href=<%="favoriteItemInfo?favoriteItemId="
			+itemId+"&pageSize="+pageSize+"&nowPage="+nowPage%> target="_blank">
			<%=item.getItemName() %>
		</a>
		<form id=<%=formId %> method="post">
	   		<input type="hidden" name="favoriteId" value=<%=favorite.getFavoriteId()%>>
	   		<input type="hidden" name="favoriteUserId" value=<%=favorite.getFavoriteUserId()%>>
	   		<input type="hidden" name="favoriteItemId" value=<%=favorite.getFavoriteItemId()%>>
	  		<input type="hidden" name="nowPage" value=<%=nowPage %>>
	   		<input type="hidden" name="pageSize" value=<%=pageSize %>>
	   		<input type="hidden" name="userId" value=<%=2 %>>
	   		<input type="submit" value="删除" onClick="<%=formId %>.action='deleteFavItemAction';">
		</form>
		
		<%
				i++;
			}
		%>
	</body>
</html>
